package ace.module.sms.core.impl.api.impl;

import ace.cmp.core.model.R;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.sms.api.SmsApi;
import ace.module.sms.api.model.input.SendTemplateInput;
import ace.module.sms.core.impl.service.SmsService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;


/**
 * 短信供应商 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class SmsApiImpl implements SmsApi {

  private final SmsService smsService;

  @Override
  public R<Void> send(Long smsAppId, String phoneNumber, String content) {
    return this.smsService.send(smsAppId, phoneNumber, content);
  }

  @Override
  public R<Void> sendTemplate(SendTemplateInput input) {
    return smsService.sendTemplate(input);
  }

  @Override
  public R<Void> sendVerifyCode(Long smsAppId, String phoneNumber, String code) {
    return this.smsService.sendVerifyCode(smsAppId, phoneNumber, code);
  }
}
